package cn.enilu.flash.dao.park;


import cn.enilu.flash.bean.entity.park.ParkingQuote;
import cn.enilu.flash.dao.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;


public interface ParkingQuoteRepository extends BaseRepository<ParkingQuote,Long>{

    @Query(value = "SELECT a.id, a.community_id as communityId, a.quote_type as quoteType, a.quote_range as quoteRange,\n" +
            "a.quote_unit as quoteUnit, a.quote_price as quotePrice\n" +
            "FROM `parking_quote` a inner join `parking_quote_ref` b on a.id=b.quote_id\n" +
            "where b.parking_id=?1", nativeQuery = true)
    List<Map<String, Object>> getParkingQuotes(Long parkingId);
}

